<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button type="primary" plain class="btn" size="mini" @click="add">添加</el-button>
        <!-- 表格 -->
        <List @edit="edit"></List>
        <!-- 弹框 -->
        <Dialog :goodstatus="goodstatus" @cancel="cancel" ref="diaRef"></Dialog>
    </div>
</template>
<script>
import Dialog from './dialog.vue'
import List from './list.vue'
export default {
    data() {
        return {
            goodstatus:{
                isShow:false,
                isAdd:true
            }
        }
    },
    methods: {
        // 点击添加显示弹框
        add(){
            this.goodstatus.isShow=true,
            this.goodstatus.isAdd = true
        },
        cancel(e){
            this.goodstatus.isShow = e
        },
        edit(id){
            this.goodstatus.isShow=true,
            this.goodstatus.isAdd = false
            this.$refs.diaRef.lookup(id)
        }
    },
    mounted() { },
    watch: {},
    computed: {},
    filters: {},
    components: {Dialog,List}
}
</script>
<style scoped>
.btn{
    margin: 10px;
}
</style>